package com.chenjt.juc.eight_CAS;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * 注释：
 *
 * @author chenjt
 * @date 2024/7/11 9:41
 */
public class CASDemo {

    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(5);

        System.out.println(atomicInteger.get());

        System.out.println(atomicInteger.compareAndSet(5,2022) + "\t" + atomicInteger.get());
        System.out.println(atomicInteger.compareAndSet(5,2022) + "\t" + atomicInteger.get());


    }

}
